package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.WorkOrderEvaluateEntity;
import com.xbongbong.saas.domain.entity.ext.WorkOrderEvaluateRateStarEntityExt;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 *
 * @author 刘阳
 * @date 2019/4/15 11:23 AM
 * @since v1.0
 * @version v1.0
 */
@Repository
@Mapper
public interface WorkOrderEvaluateDao {

    Integer insert(WorkOrderEvaluateEntity workOrderEvaluateEntity);

    Integer update(WorkOrderEvaluateEntity workOrderEvaluateEntity);

    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

    WorkOrderEvaluateEntity getByKey (@Param("key") Long key, @Param("corpid") String corpid);

    List<WorkOrderEvaluateEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param")Map<String ,Object>  param);

    WorkOrderEvaluateEntity getByWorkOrderId(@Param("workOrderId") Long workOrderId, @Param("corpid") String corpid);

    /**
     * 评价星级分组，获取各星级数量
     *
     * @param param 入参
     * @return com.xbongbong.saas.domain.entity.ext.WorkOrderEvaluateRateStarEntityExt
     * @author 徐俊杰
     * @date 2019/4/19 16:21
     * @since v1.0
     */
    List<WorkOrderEvaluateRateStarEntityExt> getRateStarCount(@Param("param") Map<String, Object> param);

}
